/*
 * ShoppingCartItem.java
 *
 * Created on April 2, 2007, 2:25 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package vendingMachine.gui;

import vendingMachine.inventory.Item;

/**
 *
 * @author Douglas LaFont
 */
public class ShoppingCartItem
{
    
    private int quantity = 0;
    private Item item;
    
    /** Creates a new instance of ShoppingCartItem */
    public ShoppingCartItem (Item item)
    {
        // Initialization of ShoppingCartItem //
        this.item = item;
        
        //System.out.println ("Now in ShoppingCartItem");
    }
    
    public Item getItem ()
    {
        //    InventoryItem myItem= null;
        return item;
    }
    
    public double getCost ()
    {
        //per Mike's request, getCost returns cost x quantity.
        return item.getPrice () * quantity;
    }
    
    public int getProductID ()
    {
        return item.getID ();
    }
    
    public int getQuantity ()
    {
        return quantity;
    }
    
    public void incrementQuantity ()
    {
        quantity++;
    }
    
    public void decrementQuantity ()
    {
        quantity--;
    }
    
}  //end class ShoppingCartItem

